// MySplitterWnd.cpp : implementation file
//

#include "stdafx.h"
#include "MySplitterWnd2.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMySplitterWnd2

CMySplitterWnd2::CMySplitterWnd2()
{
	m_nRightWidth = 500; //right for image
	m_nLeftWidth = 0;
}

CMySplitterWnd2::~CMySplitterWnd2()
{
}


BEGIN_MESSAGE_MAP(CMySplitterWnd2, CSplitterWnd)
	//{{AFX_MSG_MAP(CMySplitterWnd2)
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_MOUSEMOVE()
	ON_WM_SIZE()
	ON_WM_SETCURSOR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMySplitterWnd2 message handlers

void CMySplitterWnd2::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CWnd::OnLButtonDown(nFlags, point);
}

void CMySplitterWnd2::OnLButtonUp(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CWnd::OnLButtonUp(nFlags, point);
}

void CMySplitterWnd2::OnMouseMove(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CWnd::OnMouseMove(nFlags, point);
}

void CMySplitterWnd2::OnSize(UINT nType, int cx, int cy) 
{
	RECT rect;
	GetClientRect(&rect);
	m_nLeftWidth= rect.right- rect.left  - m_nRightWidth;
	if (m_pRowInfo != NULL) {
		if (m_nLeftWidth < 0 ) {
			SetColumnInfo(0, 1, 1);
		} else {
			SetColumnInfo(0, m_nLeftWidth, m_nLeftWidth);
		}
	}
	
	CSplitterWnd::OnSize(nType, cx, cy);
}
/*
BOOL CMySplitterWnd2::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
	// TODO: Add your message handler code here and/or call default
	
	return CSplitterWnd::OnSetCursor(pWnd, nHitTest, message);
}*/
